#ifndef OBSERVER_H
#define OBSERVER_H

#include <list>
#include "Singleton.h"
#include "Event.h"

class ABObserver;

class Observer : public Singleton<Observer>
{
public:
	Observer();
	virtual ~Observer();

	bool AttachObserver(ABObserver* a_pObserver);
	bool DetachObserver(ABObserver* a_pObserver);
	void NotifyObservers(const Event* a_event);

	void Update();

	const unsigned int Hash(const char* a_pKey);

private:
	typedef std::list<ABObserver*> ObserverList;
	ObserverList m_observers;
};

#endif //OBSERVER_H